import OpenEXR
import Imath
import math
import time
import numpy as np
def writeEXR(fileName,outputR,outputG,outputB, sz):
    
    print "Writing "+fileName
    
    (strR, strG, strB) = [Channel.tostring() for Channel in (outputR, outputG, outputB)]
    
    patchOut  = OpenEXR.OutputFile(fileName, OpenEXR.Header(sz[0], sz[1]))
    
    patchOut.writePixels({'R' : strR, 'G' : strG, 'B' : strB})